document.addEventListener('DOMContentLoaded', () => {
    var likesbtn = document.getElementById('likes-btn')
    var likes = document.getElementById('likes-num')
    likesbtn.addEventListener('click', () => {
      fetch('/images/likes/' + likesbtn.dataset.imageid, {method: 'POST'})
        .then(response => response.json())
        .then(data => {
          //实时点赞功能
          likes.textContent = data.likes
        })
    })
  })